﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<MvcFrontEnd.Models.ViewFeed>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Preview
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2>Preview</h2>  
    <p><%=Model.Title %></p> 
    <% using (Html.BeginForm("AcceptPreview")) {%>
        <%: Html.ValidationSummary(true) %>

        <fieldset>
            <legend>Fields</legend>
            <div class="editor-label">
                <%= Html.LabelFor(model => model.url) %>
            </div>
            <div class="editor-field">
                <%= Html.TextBoxFor(model => model.url) %>
                <%= Html.ValidationMessageFor(model => model.url) %>
            </div>
            <p>
                <input type="submit" value="Accept Preview" />
            </p>
        </fieldset>     
     <table>
          
    <% foreach (var item in Model.posts) { %>
            <tr>
            <td>
                <a href = "<%= Html.Encode(item.url) %>"><%= Html.Encode(item.Title) %></a>
                <br />
                <p><%= Html.Encode(item.Date.ToString()) %></p>
            </td>

        </tr>
        <tr><td><%= item.Content%> </td></tr>
    
    <% } %>

    </table>

</asp:Content>

